<template>
<main>
	<div class="header"></div>
  <div class="top">
        <img src="../assets/images/logo.png">
        <input type="text" name="keywords" v-model="keywords">
        <div class="btn" @click="search">搜索</div>
      </div>
	<div class="news">

        <NewsList :list="news"></NewsList>
 		<div style="clear:both;"></div>		
	</div>		
	<Footer></Footer>
</main>
</template>
<script>
import { News } from '../api'
import NewsList from './common/NewsList'
import Footer from './common/Footer'
import {Swiper, SwiperItem} from 'mand-mobile'

export default {
  name: 'swiper-demo',
  components: {
    [Swiper.name]: Swiper,
    [SwiperItem.name]: SwiperItem,
    Footer,
    NewsList
  },
  data() {
    return {
    	news:{},
      page:'1',
      keywords:'',
  	}
  },
  mounted() {
   
  },
  created() {
    
  },
  methods: {
    search() {
      News({page:this.page,title:this.keywords}).then(res=>{
        this.news = res.list
      
          console.log(res); 

        if(this.page == 1)
        {
          this.list = res;
        }else {
          this.list = this.list.concat(res);
        }
        this.page += 1

      })
    }
  },
}

</script>